#pragma once

#include "resource.h"

#include <d3d9.h>

class TwGameApplication
{
public:
	TwGameApplication(){};
	~TwGameApplication(){};
public:

	void CreateGameWnd(HWND hwnd);
	BOOL InitDevice();
	BOOL InitEngine();
	void InitCamera();
	
	void Update();
	void Render();

	void LogicFrame(float fElapsedTime);
	void RenderFrame(float fElapsedTime);
	void HandleMsg( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );

	bool PickTerrain();
	bool PickEntity();


	void Clear();

private:
	HWND					m_hwnd;
	LPDIRECT3D9             g_pD3D;
	LPDIRECT3DDEVICE9       g_pd3dDevice;
};
extern  TwGameApplication* g_GameApp;